//#define __FORCE_TRACE__
//#define __FORCE_DEBUG__
//#define __FORCE_INFO__
#define THIS_FILE "tyr_menu\fn_close.sqf"
#include <core_macros.h>

TRACE_1("Start",_this);
TMFPROFILERSTART;

private ["_handled"];
_handled = false;
if (GVAR(is_open)) then {
	if (GVAR(TYR_MENU_LAYER) >= 0) then {
		TRACE_1("Closing on layer",GVAR(TYR_MENU_LAYER));
	};
	if (GVAR(is_open)) then {
		//closedialog 91650;
		GVAR(TYR_MENU_LAYER) cutText ["","PLAIN"];
		GVAR(is_open) = false;
		GVAR(MouseChange) = 0;
		GVAR(last_open) = -100;
		_handled = true;
	};
};
GVAR(CustomUserMenuOpen)=false;
if (commandingMenu == GVAR(CustomUserMenuName)) then {
	showCommandingMenu "";
};

TRACE_1("End",_handled);
TMFPROFILERSTOP;
_handled